Skip to content

Disallow opening and accepting 0-reserve legacy channels#4613

Draft
tankyleo wants to merge 8 commits into
lightningdevkit:mainfrom
tankyleo:2026-05-ban-0reserve-legacy-chans
Draft

Disallow opening and accepting 0-reserve legacy channels#4613
tankyleo wants to merge 8 commits into
lightningdevkit:mainfrom
tankyleo:2026-05-ban-0reserve-legacy-chans

Conversation

@tankyleo
Copy link
Copy Markdown
Contributor

Based on #4574

tankyleo added 8 commits May 12, 2026 08:17
We previously accounted for HTLC trims at the spiked feerate when
calculating the reserved commitment transaction fees.

This could cause an underestimate of the real current commitment fee at
the current channel feerate. This is because a 2x increase in the
feerate could trim enough HTLCs to result in a smaller commitment
transaction fee.

Also, the previous code only reserved the fee for an exact 2x increase
in the feerate, instead of reserving the fee for any increase in the
feerate between 1x to 2x.

Fixes lightningdevkit#4563.
In the next commit, we will make changes to how the fee spike buffer is
calculated which require the real feerate to always be passed to
`tx_builder::get_next_commitment_stats`, even in the case where we
include a fee spike multiple.
We previously accounted for HTLC trims at the spiked feerate when
calculating the commitment transaction fee including the fee spike
multiple.

This only ensured that the funder of the channel could afford the
commitment transaction fee for an exact 2x increase in the feerate.

Now, we check that the funder can cover any increase in the feerate
between 1x to 2x.
@ldk-reviews-bot
Copy link
Copy Markdown

👋 Hi! I see this is a draft PR.
I'll wait to assign reviewers until you mark it as ready for review.
Just convert it out of draft status when you're ready for review!

@tankyleo tankyleo added this to the 0.3 milestone May 13, 2026
@tankyleo tankyleo moved this to Goal: Merge in Weekly Goals May 13, 2026
@tankyleo tankyleo self-assigned this May 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Goal: Merge

Development

Successfully merging this pull request may close these issues.

2 participants